<?php
/** 
 * 首页
 *
 * @author   xg
 * @date     2019-09-12
 */

namespace app\home\controller;

use app\base\controller\Backend;
use app\home\model\AuthRuleModel;

class Index extends Backend
{

    protected $noNeedLogin = [];

    protected $noNeedRight = [
        'home/index/index',
        'home/index/menu',
    ];

    /**
     * 默认方法
     */
    public function index()
    {
        $this->success('成功', ['uid' => $this->user_id]);
    }

    public function menu()
    {
        $rule_model = new AuthRuleModel();
        $rule_data  = $rule_model->getMenu();

        if (empty($rule_data)) {
            $this->error('错误');
        }

        $this->success('成功', $rule_data);
    }

}